package com.guigu.www.tangyingmeng.controller;

import com.guigu.www.pojo.SingleDayAppointment;
import com.guigu.www.tangyingmeng.service.TymSingleDayAppointmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/single")
public class TymSingleDayAppointmentController {

    @Autowired
    private TymSingleDayAppointmentService service;

    @PostMapping("/singlesel")
    public List<SingleDayAppointment> selSingle(){
        List<SingleDayAppointment> list = service.selSingle();
        return list;
    }

    @GetMapping("/selsingleone/{time}")
    public SingleDayAppointment selSingleOne(@PathVariable("time") String time){
        SingleDayAppointment singleone = service.selSingleone(time);
        return singleone;
    }

    @PostMapping("/singleapp")
    public Boolean singleapp(@RequestBody SingleDayAppointment single){
        Boolean flag = service.singleapp(single);
        return flag;
    }
}
